package main

import "fmt"

type User struct {
	name string
	age int
}

func (u *User) learn(){
	fmt.Println(u.name + "学习中....")  // 需要传入指针才行呀
}


type X struct {}

func (x *X)test() {
	println("h1", x)
}

func main(){
	user := User{}
	user.learn()

	//User{}.learn()   // cannot call pointer method on User literal   需要闯入的是指针才行
	//(User{}).learn()

	//(&X{}).test()
	}
